package org.example.ACM;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ipTest {
    static List<String> res = new ArrayList<>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        List<String> res = ipIsTrue(s);
        System.out.println(res);
    }

    private static List<String> ipIsTrue(String s) {
        int startIndex = 0;
        int pointNum = 0;
        searchIp(s, startIndex, pointNum);
        return res;
    }

    private static void searchIp(String s, int startIndex, int pointNum) {
        if (pointNum == 3) {
            if (ipIsValid(s, startIndex, s.length() - 1)) {
                res.add(s);
            }
            return;
        }
        for (int i = startIndex; i < s.length(); i++) {
            if (ipIsValid(s, startIndex, i)) {
                pointNum++;
                s = s.substring(0, i + 1) + "." + s.substring(i + 1);
                searchIp(s, i + 2, pointNum);
                s = s.substring(0, i + 1) + s.substring(i + 2);
                pointNum--;
            } else {
                break;
            }
        }
    }

    private static boolean ipIsValid(String s, int start, int end) {
        if (start > end) {
            return false;
        }
        if (start != end && s.charAt(start) == '0') {
            return false;
        }
        int num = 0;
        for (int i = start; i <= end; i++) {
            num = num * 10 + (s.charAt(i) - '0');
            if (num > 255) {
                return false;
            }
        }
        return true;
    }

}